package com.shui_shui;

import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;

public class MenuBar implements OnTouchListener{
	
	private ImageView back;
	private ImageView help;
	
	public MenuBar(ImageView back,ImageView help){
		this.back = back;
		this.help = help;

		this.back.setOnTouchListener(this);
		this.help.setOnTouchListener(this);
	}

	@SuppressWarnings("deprecation")
	public boolean onTouch(View v, MotionEvent event) {
		switch (v.getId()) {              
		case R.id.back:            
			switch (event.getAction()) {            
			case MotionEvent.ACTION_DOWN:            
				back.setAlpha(150);                
				break;            
			case MotionEvent.ACTION_UP:            
				back.setAlpha(255);	
				break;            
			default:                
				break;            
			}            
			break;        
		case R.id.help:            
			switch (event.getAction()) {            
			case MotionEvent.ACTION_DOWN:            
				help.setAlpha(150);                
				break;            
			case MotionEvent.ACTION_UP:            
				help.setAlpha(255);                
				break;            
			default:                
				break;            
			}            
			break;        
		}        
		return true;
	}

}
